<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.js"></script>
    <style>
        html,body{
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body>
    <input type="text" id="txt">
    <script>
        var oTxt=document.querySelector("#txt");
        oTxt.oninput=_.debounce(function(){
            console.log(this.value);
        },2000);

        document.onmousemove=_.debounce(function(){
            
        })
    </script>
</body>
</html>